package com.planetarium;

import javax.swing.JFrame;

import com.planetarium.objects.PlanetarySystem;

public class Window {
	
	private final static String WINDOW_NAME = "Planetarium";
	private JSolarSystem renderer;

	public Window() {
		JFrame window = new JFrame(WINDOW_NAME);
		window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		renderer = new JSolarSystem();
		window.getContentPane().add(renderer);
		
		window.pack();
		window.setVisible(true);
	}

	public void setSolarSystem(PlanetarySystem dummySystem) {
		renderer.setSolarSystem(dummySystem);
	}
	
	/*
	 * 
	 *  Invalidate window to trigger re-rendering. 
	 *  
	 */
	
	public void invalidate() {
		renderer.invalidate();
	}

}
